package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenFormfieldsMapper;
import com.server.pinggu.domain.SenFormfields;
import com.server.pinggu.service.ISenFormfieldsService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenFormfieldsServiceImpl extends ServiceImpl<SenFormfieldsMapper, SenFormfields> implements ISenFormfieldsService {

    @Override
    public List<SenFormfields> queryList(SenFormfields senFormfields) {
        LambdaQueryWrapper<SenFormfields> lqw = Wrappers.lambdaQuery();
        if (senFormfields.getPid() != null){
            lqw.eq(SenFormfields::getPid ,senFormfields.getPid());
        }
        if (StringUtils.isNotBlank(senFormfields.getTitle())){
            lqw.eq(SenFormfields::getTitle ,senFormfields.getTitle());
        }
        if (senFormfields.getFtype() != null){
            lqw.eq(SenFormfields::getFtype ,senFormfields.getFtype());
        }
        if (StringUtils.isNotBlank(senFormfields.getSets())){
            lqw.eq(SenFormfields::getSets ,senFormfields.getSets());
        }
        if (senFormfields.getOrdering() != null){
            lqw.eq(SenFormfields::getOrdering ,senFormfields.getOrdering());
        }
        if (senFormfields.getClas() != null){
            lqw.eq(SenFormfields::getClas ,senFormfields.getClas());
        }
        if (StringUtils.isNotBlank(senFormfields.getCode())){
            lqw.eq(SenFormfields::getCode ,senFormfields.getCode());
        }
        if (StringUtils.isNotBlank(senFormfields.getDepOn())){
            lqw.eq(SenFormfields::getDepOn ,senFormfields.getDepOn());
        }
        if (StringUtils.isNotBlank(senFormfields.getInfo())){
            lqw.eq(SenFormfields::getInfo ,senFormfields.getInfo());
        }
        if (senFormfields.getComb() != null){
            lqw.eq(SenFormfields::getComb ,senFormfields.getComb());
        }
        if (senFormfields.getDel() != null){
            lqw.eq(SenFormfields::getDel ,senFormfields.getDel());
        }
        return this.list(lqw);
    }
}